﻿Imports XL.Common
Imports XL.Common.Utils
Imports System.Collections
Imports System.Data

Namespace Facade

    Public Class OpBizMaster

        Public Shared Function GetAutoClientCode() As String
            Dim result As New LineStrBuilder
            Dim clientRow As New RExpXAuto.FTs.FT_M_REXP_CLIENTRowSEntity
            Dim clientCondition As New RExpXAuto.Facade.AfBizMaster.ConditionOfM_REXP_CLIENT(XL.DB.Utils.Condition.LogicOperators.Logic_And)

            Do
                Dim seedValue = OpSysConfig.GetNewSeedID(Decls.SPX_CLIENT_CODE)

                result.AppendLine("{0}{1:00000}", SysInfo.ReadShareSysInfo(Decls.SVN_UTLD_005), seedValue)
                clientCondition.Clear()
                clientCondition.Add(RExpXAuto.Facade.AfBizMaster.M_REXP_CLIENTColumns.CLIENT_CODEColumn, "=", result.ToString)
                RExpXAuto.Facade.AfBizMaster.FillM_REXP_CLIENTRowSEntity(clientRow, clientCondition)

            Loop While clientRow.IsNull = False

            Return result.ToString
        End Function


    End Class

End Namespace

